package lab02.test13;

import java.util.Arrays;

public class Gymnastics extends ComputerAverage {
    double average = 0;

    @Override
    double getAverage(int[] scores) {
        Arrays.sort(scores);    //对数组进行排序
        for (int i = 0; i < scores.length; i++) {
            System.out.println("第" + (i + 1) + "个学生的成绩.");
            System.out.println(scores[i]);
        }

        for (int i = 1; i < scores.length - 1; i++) {
            average = average + scores[i];
        }
        return average / (scores.length - 2);
    }

}
